/* macOS 现代化风格 - iOS 17/macOS Sonoma 设计语言 */

/* macOS 圆角样式 */
:root {
  --radius: 10px;
}

/* macOS 蓝色主题 */
:root {
  --primary: 211 100% 50%;
  --primary-foreground: 0 0% 100%;
}

/* macOS 按钮样式 - 现代化设计 */
.macos-button {
  @apply rounded-xl font-medium transition-all duration-200;
  background: rgba(255, 255, 255, 0.95);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  box-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.08),
    0 0 0 0.5px rgba(255, 255, 255, 0.5) inset;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.macos-button:hover {
  background: rgba(248, 248, 248, 0.98);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.1),
    0 0 0 0.5px rgba(255, 255, 255, 0.6) inset;
  transform: translateY(-0.5px);
}

.macos-button:active {
  background: rgba(238, 238, 238, 0.98);
  transform: translateY(0);
  box-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.1) inset,
    0 0 0 0.5px rgba(0, 0, 0, 0.05) inset;
}

/* macOS 主要按钮（蓝色）- 现代化设计 */
.macos-button-primary {
  @apply rounded-xl font-semibold text-white transition-all duration-200;
  background: linear-gradient(180deg, #0A84FF 0%, #0066D6 100%);
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  box-shadow: 
    0 2px 8px rgba(10, 132, 255, 0.3),
    0 1px 2px rgba(0, 0, 0, 0.15),
    0 0 0 0.5px rgba(255, 255, 255, 0.2) inset;
}

.macos-button-primary:hover {
  background: linear-gradient(180deg, #1A8FFF 0%, #0073E6 100%);
  box-shadow: 
    0 4px 12px rgba(10, 132, 255, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.2),
    0 0 0 0.5px rgba(255, 255, 255, 0.25) inset;
  transform: translateY(-1px);
}

.macos-button-primary:active {
  background: linear-gradient(180deg, #0066D6 0%, #0055B8 100%);
  transform: translateY(0);
  box-shadow: 
    0 1px 3px rgba(10, 132, 255, 0.2),
    0 1px 2px rgba(0, 0, 0, 0.2) inset;
}

/* macOS 日历样式 - 现代化毛玻璃设计 */
.macos-calendar {
  @apply rounded-2xl;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.08),
    0 0 0 0.5px rgba(255, 255, 255, 0.5) inset;
}

.macos-calendar-header {
  @apply text-sm font-semibold;
  color: #1d1d1f;
  letter-spacing: -0.01em;
}

.macos-calendar-day {
  @apply rounded-full transition-all duration-200;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.macos-calendar-day:hover {
  background: rgba(120, 120, 128, 0.12);
  transform: scale(1.05);
}

.macos-calendar-day-selected {
  background: linear-gradient(180deg, #0A84FF 0%, #0066D6 100%);
  color: white;
  font-weight: 600;
  box-shadow: 
    0 2px 8px rgba(10, 132, 255, 0.4),
    0 1px 2px rgba(0, 0, 0, 0.15);
}

.macos-calendar-day-selected:hover {
  background: linear-gradient(180deg, #1A8FFF 0%, #0073E6 100%);
  transform: scale(1.05);
}

.macos-calendar-day-today {
  background: rgba(10, 132, 255, 0.1);
  color: #0A84FF;
  font-weight: 600;
  position: relative;
}

.macos-calendar-day-today::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: #0A84FF;
  border-radius: 50%;
}

.macos-calendar-nav-btn {
  @apply inline-flex items-center justify-center rounded-full transition-all duration-200;
  width: 28px;
  height: 28px;
  color: #86868B;
  background: transparent;
  border: none;
}

.macos-calendar-nav-btn:hover {
  background: rgba(120, 120, 128, 0.12);
  color: #1d1d1f;
}

.macos-calendar-nav-btn:active {
  background: rgba(120, 120, 128, 0.18);
  transform: scale(0.95);
}

/* macOS Popover 样式 - 现代化毛玻璃效果 */
.macos-popover {
  @apply rounded-2xl;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  box-shadow: 
    0 16px 48px rgba(0, 0, 0, 0.15),
    0 4px 16px rgba(0, 0, 0, 0.1),
    0 0 0 0.5px rgba(255, 255, 255, 0.5) inset;
}

/* macOS Select 样式 - 现代化设计 */
.macos-select-trigger {
  @apply rounded-xl bg-white transition-all duration-200;
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  box-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.08),
    0 0 0 0.5px rgba(255, 255, 255, 0.5) inset;
}

.macos-select-trigger:hover {
  border-color: rgba(0, 0, 0, 0.18);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.1),
    0 0 0 0.5px rgba(255, 255, 255, 0.6) inset;
}

.macos-select-trigger:focus {
  border-color: #0A84FF;
  box-shadow: 
    0 0 0 3px rgba(10, 132, 255, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.1),
    0 0 0 0.5px #0A84FF inset;
}

.macos-select-content {
  @apply rounded-2xl;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  box-shadow: 
    0 16px 48px rgba(0, 0, 0, 0.15),
    0 4px 16px rgba(0, 0, 0, 0.1),
    0 0 0 0.5px rgba(255, 255, 255, 0.5) inset;
}

.macos-select-item {
  @apply rounded-lg transition-all duration-150;
  font-weight: 500;
}

.macos-select-item:hover {
  background: rgba(120, 120, 128, 0.12);
}

.macos-select-item[data-state="checked"] {
  background: linear-gradient(180deg, #0A84FF 0%, #0066D6 100%);
  color: white;
  font-weight: 600;
  box-shadow: 
    0 2px 6px rgba(10, 132, 255, 0.3),
    0 1px 2px rgba(0, 0, 0, 0.1);
}

/* macOS 输入框样式 - 现代化设计 */
.macos-input {
  @apply rounded-xl bg-white px-3 py-2;
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  box-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.08),
    0 0 0 0.5px rgba(255, 255, 255, 0.5) inset;
  font-size: 13px;
  font-weight: 400;
  color: #1D1D1F;
  transition: 
    border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.macos-input::placeholder {
  color: #86868B;
  opacity: 1;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.macos-input:hover:not(:focus) {
  border-color: rgba(0, 0, 0, 0.2);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.1),
    0 0 0 0.5px rgba(255, 255, 255, 0.6) inset;
  background: rgba(255, 255, 255, 0.98);
}

.macos-input:focus {
  @apply outline-none;
  border-color: #007AFF;
  box-shadow: 
    0 0 0 3.5px rgba(0, 122, 255, 0.15),
    0 2px 6px rgba(0, 0, 0, 0.1),
    0 0 0 0.5px #007AFF inset;
  background: rgba(255, 255, 255, 1);
  transform: translateY(-1px);
}

.macos-input:focus::placeholder {
  opacity: 0.6;
}

/* 深色模式 */
html.dark-mode .macos-input {
  background: rgba(58, 58, 62, 0.6);
  border-color: rgba(255, 255, 255, 0.12);
  color: #F5F5F7;
  box-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 0 0 0.5px rgba(255, 255, 255, 0.05) inset;
}

html.dark-mode .macos-input::placeholder {
  color: #8E8E93;
}

html.dark-mode .macos-input:hover:not(:focus) {
  background: rgba(68, 68, 72, 0.75);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.2),
    0 0 0 0.5px rgba(255, 255, 255, 0.08) inset;
}

html.dark-mode .macos-input:focus {
  background: rgba(58, 58, 62, 0.85);
  border-color: #0A84FF;
  box-shadow: 
    0 0 0 3.5px rgba(10, 132, 255, 0.18),
    0 2px 6px rgba(0, 0, 0, 0.3),
    0 0 0 0.5px #0A84FF inset;
}

/* macOS 滚动条样式 */
.macos-scrollbar::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.macos-scrollbar::-webkit-scrollbar-track {
  @apply bg-transparent;
}

.macos-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(120, 120, 128, 0.2);
  border-radius: 100px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background-color 0.2s ease;
}

.macos-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(120, 120, 128, 0.35);
  background-clip: padding-box;
}

.macos-scrollbar::-webkit-scrollbar-thumb:active {
  background: rgba(120, 120, 128, 0.5);
  background-clip: padding-box;
}

/* macOS 现代化动画 */
@keyframes macos-fade-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.macos-fade-in {
  animation: macos-fade-in 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes macos-scale-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.macos-scale-in {
  animation: macos-scale-in 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

/* 弹簧动画 */
@keyframes macos-spring {
  0% {
    transform: scale(0.95);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

.macos-spring {
  animation: macos-spring 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* macOS 按钮变体 */
.macos-button-ghost {
  @apply rounded-xl font-medium transition-all duration-200;
  background: transparent;
  border: none;
}

.macos-button-ghost:hover {
  background: rgba(120, 120, 128, 0.12);
}

.macos-button-ghost:active {
  background: rgba(120, 120, 128, 0.18);
  transform: scale(0.98);
}

.macos-button-destructive {
  @apply rounded-xl font-semibold text-white transition-all duration-200;
  background: linear-gradient(180deg, #FF453A 0%, #D93832 100%);
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  box-shadow: 
    0 2px 8px rgba(255, 69, 58, 0.3),
    0 1px 2px rgba(0, 0, 0, 0.15),
    0 0 0 0.5px rgba(255, 255, 255, 0.2) inset;
}

.macos-button-destructive:hover {
  background: linear-gradient(180deg, #FF5449 0%, #E63E36 100%);
  box-shadow: 
    0 4px 12px rgba(255, 69, 58, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.2),
    0 0 0 0.5px rgba(255, 255, 255, 0.25) inset;
  transform: translateY(-1px);
}

.macos-button-destructive:active {
  background: linear-gradient(180deg, #D93832 0%, #C2312A 100%);
  transform: translateY(0);
  box-shadow: 
    0 1px 3px rgba(255, 69, 58, 0.2),
    0 1px 2px rgba(0, 0, 0, 0.2) inset;
}

.macos-button-link {
  @apply font-medium transition-all duration-200;
  background: transparent;
  border: none;
  color: #0A84FF;
  text-decoration: none;
}

.macos-button-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.macos-button-link:active {
  opacity: 0.7;
}

/* macOS Focus 环 - 现代化设计 */
.macos-focus-ring:focus-visible {
  outline: none;
  box-shadow: 
    0 0 0 3px rgba(10, 132, 255, 0.15),
    0 0 0 1px #0A84FF;
}

/* macOS 卡片样式 */
.macos-card {
  @apply rounded-2xl transition-all duration-200;
  background: rgba(255, 255, 255, 0.9);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.08),
    0 1px 4px rgba(0, 0, 0, 0.06),
    0 0 0 0.5px rgba(255, 255, 255, 0.5) inset;
}

.macos-card:hover {
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.08),
    0 0 0 0.5px rgba(255, 255, 255, 0.6) inset;
  transform: translateY(-2px);
}

/* macOS 分割线 */
.macos-divider {
  height: 0.5px;
  background: rgba(0, 0, 0, 0.08);
  border: none;
}

/* macOS 徽章 */
.macos-badge {
  @apply inline-flex items-center justify-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-all;
  background: rgba(10, 132, 255, 0.1);
  color: #0A84FF;
  border: 0.5px solid rgba(10, 132, 255, 0.2);
}

/* macOS 工具提示 */
.macos-tooltip {
  @apply rounded-lg px-3 py-1.5 text-xs font-medium;
  background: rgba(60, 60, 67, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: white;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.15);
}

/* macOS 列表项 */
.macos-list-item {
  @apply rounded-lg px-3 py-2 transition-all duration-150;
  background: transparent;
}

.macos-list-item:hover {
  background: rgba(120, 120, 128, 0.12);
}

.macos-list-item:active {
  background: rgba(120, 120, 128, 0.18);
  transform: scale(0.99);
}

.macos-list-item.selected {
  background: linear-gradient(180deg, #0A84FF 0%, #0066D6 100%);
  color: white;
  font-weight: 600;
}

/* macOS 时间选择器样式 - 滚动选择器 */
.macos-time-picker-panel {
  @apply flex flex-col;
  width: 260px;
  padding: 16px;
  gap: 16px;
}

.macos-time-picker-selectors {
  @apply flex items-center justify-center;
  gap: 12px;
}

.macos-time-picker-column {
  @apply flex flex-col items-center;
  flex: 1;
  gap: 8px;
}

.macos-time-picker-label {
  @apply text-center font-semibold tracking-wide;
  font-size: 11px;
  color: #86868B;
  text-transform: none;
}

.macos-time-picker-scroll-wrapper {
  position: relative;
  width: 100%;
  height: 160px;
  border-radius: 12px;
  overflow: hidden;
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  box-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.08),
    0 0 0 0.5px rgba(255, 255, 255, 0.5) inset;
}

.macos-time-picker-scroll-wrapper:hover {
  border-color: rgba(0, 0, 0, 0.18);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.1),
    0 0 0 0.5px rgba(255, 255, 255, 0.6) inset;
}

.macos-time-picker-scroll {
  @apply bg-white;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  
  /* 隐藏滚动条 */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.macos-time-picker-scroll::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Opera */
}

/* 上下留白，让第一个和最后一个选项也能滚动到中间 */
.macos-time-picker-padding {
  height: 60px;
  flex-shrink: 0;
}

/* 中间选择指示器 */
.macos-time-picker-indicator {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 40px;
  pointer-events: none;
  z-index: 2;
  border-radius: 8px;
  background: rgba(10, 132, 255, 0.08);
  border-top: 0.5px solid rgba(10, 132, 255, 0.2);
  border-bottom: 0.5px solid rgba(10, 132, 255, 0.2);
}

/* 上下渐变遮罩 */
.macos-time-picker-fade {
  position: absolute;
  left: 0;
  right: 0;
  height: 50px;
  pointer-events: none;
  z-index: 3;
}

.macos-time-picker-fade-top {
  top: 0;
  background: linear-gradient(to bottom, 
    rgba(255, 255, 255, 1) 0%, 
    rgba(255, 255, 255, 0.9) 30%,
    rgba(255, 255, 255, 0) 100%
  );
}

.macos-time-picker-fade-bottom {
  bottom: 0;
  background: linear-gradient(to top, 
    rgba(255, 255, 255, 1) 0%, 
    rgba(255, 255, 255, 0.9) 30%,
    rgba(255, 255, 255, 0) 100%
  );
}

.macos-time-picker-option {
  @apply w-full text-center transition-all duration-200;
  padding: 10px 12px;
  height: 40px;
  font-size: 14px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: #86868B;
  background: transparent;
  border: none;
  cursor: pointer;
  outline: none;
  user-select: none;
  scroll-snap-align: center;
  flex-shrink: 0;
}

.macos-time-picker-option:hover {
  color: #1d1d1f;
}

.macos-time-picker-option:active {
  transform: scale(0.95);
}

/* 选中的选项（在中间的） */
.macos-time-picker-option-selected {
  color: #1d1d1f;
  font-weight: 600;
  font-size: 16px;
}

.macos-time-picker-separator {
  @apply font-bold;
  font-size: 20px;
  color: #86868B;
  margin-top: 24px;
  user-select: none;
}

.macos-time-picker-actions {
  @apply flex gap-2 justify-end pt-3;
  border-top: 0.5px solid rgba(0, 0, 0, 0.08);
}

/* 响应式字体大小 */
@media (max-width: 640px) {
  .macos-calendar-header {
    font-size: 13px;
  }
  
  .macos-calendar-day {
    font-size: 12px;
  }
  
  .macos-time-picker-panel {
    width: 240px;
    padding: 12px;
  }
  
  .macos-time-picker-scroll-wrapper {
    height: 140px;
  }
  
  .macos-time-picker-indicator {
    height: 36px;
  }
  
  .macos-time-picker-option {
    font-size: 13px;
    height: 36px;
    padding: 8px 10px;
  }
  
  .macos-time-picker-option-selected {
    font-size: 15px;
  }
  
  .macos-time-picker-padding {
    height: 52px;
  }
  
  .macos-time-picker-fade {
    height: 45px;
  }
}

